package com.gf.framework.common.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
 * 分页参数
 *
 * @author gaofei
 * @since 2022-05-22
 */
@Data
public class BasePageDto {
    @ApiModelProperty(value = "页码", required = true)
    @NotNull(message = "分页页码参数为必填项")
    @Min(value = 1, message = "分页页码不能小于1")
    private Integer pageIndex = null;

    @ApiModelProperty(value = "分页长度", required = true)
    @NotNull(message = "分页大小参数为必填项")
    @Min(value = 1, message = "分页大小不能小于1")
    private Integer length = null;

    @ApiModelProperty(value = "排序（在字段名前加“asc:或desc:”指定升序（降序），多个字段使用#分隔，省略排序默认使用升序）", example = "asc:字段1#desc:字段2")
    private String order = null;
}
